// 存放首页的数据
import Mock from 'mockjs'

let List=[]
export default{
    getStatisticalData:()=>{
        List = []
        for(let i =0; i < 6; i++){//横轴有多少个就应为多少，给6次，自己push最后一天的
            // List.push(
            //     Mock.mock({
            //         //少了一组（现在不少了）折线图
            //         // 领取:Mock.Random.float(5,30,0,0),
            //         // 流动:Mock.Random.float(5,30,0,0),
            //         // 收到:Mock.Random.float(5,30,0,0),
                    
            //     })
            // )
            const received = Mock.Random.float(5, 30, 0, 0); // 生成收到数据
            const claimed = Mock.Random.float(5, 30, 0, 0); // 生成领取数据
            const flow = received + claimed; // 计算流动数据，等于收到数据和领取数据之和
            List.push({
                领取: claimed,
                流动: flow,
                收到: received
            });
        }
        List.push({
            领取: 21,
            流动: 53,
            收到: 32
        })
        return{
            code:20000,
            data:{
                //饼图
                videoData:[
                    {
                        name:'计算机学院',
                        value:659
                    },
                    {
                        name:'人工智能学院',
                        value:356
                    },
                    {
                        name:'信息与通信工程学院',
                        value:547
                    },
                    {
                        name:'电子工程学院',
                        value:647
                    },
                    {
                        name:'人文学院',
                        value:236
                    },
                    {
                        name:'数字媒体与设计艺术学院',
                        value:544
                    },
                    {
                        name:'理学院',
                        value:812
                    },
                ],
                //柱状图
                userData:[
                    {
                        date:'周一',
                        new:5,
                        active:33
                    },
                    {
                        date:'周二',
                        new:1,
                        active:45
                    },
                    {
                        date:'周三',
                        new:10,
                        active:64
                    },
                    {
                        date:'周四',
                        new:6,
                        active:48
                    },
                    {
                        date:'周五',
                        new:7,
                        active:69
                    },
                    {
                        date:'周六',
                        new:10,
                        active:101
                    },
                    {
                        date:'周日',
                        new:15,
                        active:76
                    },
                ],
                //折线图
                orderData:{
                    date:['20240417','20240418','20240419','20240420','20240421','20240422','20240423'],
                    data:List
                },
                //表格
                tableData:[
                    {
                        name:'通信原理',
                        todayBuy:3,
                        monthBuy:77,
                        totalBuy:221
                    },
                    {
                        name:'数据结构与算法',
                        todayBuy:2,
                        monthBuy:54,
                        totalBuy:192
                    },
                    {
                        name:'电子电路测量与设计',
                        todayBuy:0,
                        monthBuy:36,
                        totalBuy:177
                    },
                    {
                        name:'高等数学',
                        todayBuy:2,
                        monthBuy:45,
                        totalBuy:175
                    },
                    {
                        name:'离散数学',
                        todayBuy:0,
                        monthBuy:36,
                        totalBuy:166
                    },
                    {
                        name:'英语视听说',
                        todayBuy:1,
                        monthBuy:22,
                        totalBuy:130
                    },
                    {
                        name:'数字电路',
                        todayBuy:2,
                        monthBuy:25,
                        totalBuy:121
                    },
                    {
                        name:'Java从入门到精通',
                        todayBuy:0,
                        monthBuy:12,
                        totalBuy:115
                    },
                ]
            }
        }
    }
}